package com.loan.job.service;

import com.loan.system.service.ApplyService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author shiguang on 2022/9/22 10:43
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class PayJobService {


    private final ApplyService applyService;

    /**
     * 打款
     * @throws Exception
     */
    @XxlJob("payHandler")
    public void payApply() throws Exception {
        XxlJobHelper.log("run payHandler.");
        applyService.pay();
    }

    /**
     *
     * @throws Exception
     */
    @XxlJob("queryPayOrderApplyHandler")
    public void queryPayOrderApply() throws Exception {
        XxlJobHelper.log("run queryPayOrderApplyHandler.");
        applyService.queryPayOrderApply();
    }

    /**
     * 查询虚拟账户是否还款
     */
    @XxlJob("queryHqVaRepayLog")
    public void queryHqVaRepayLog(){
        XxlJobHelper.log("run queryHqVaRepayLog.");
        applyService.queryHqVaRepayLog();
    }
}
